<?php


namespace App\Models;


class ForwarderLine extends BaseModel
{
    protected $table = 'forwarder_line';

    protected $fillable = [
        'user_id',
        'forwarder_id',
        'img',
        'title',
        'from',
        'to',
        'transportation',
        'remark',
        'serve',
        'job_time',
        'cargo',
        'weight_type',
        'weight_num',
        'tax',
        'customs',
        'status',
    ];

    public function getServeAttribute($value)
    {
        return explode(',', $value);
    }

    public function setServeAttribute($value)
    {
        $this->attributes['serve'] = implode(',', $value);
    }
    public function getCargoAttribute($value)
    {
        return explode(',', $value);
    }

    public function setCargoAttribute($value)
    {
        $this->attributes['cargo'] = implode(',', $value);
    }
}
